package day06;

import java.util.Arrays;

public class ArrayDemo {
    public static void main(String[] args) {
        int[] a = new int[]{1, 2, 3, 4, 5, 6};
        int[] b=Arrays.copyOf(a,9); //超出原数组长度末尾补零;
        for (int i = 0; i < b.length; i++) {
            System.out.println(b[i]);
        }


//        int[] a = new int[]{1, 2, 3, 4, 5};
//        int[] b = new int[6];
//        System.arraycopy(a, 0, b, 0, 5);
//        for (int i = 0; i < b.length; i++) {
//            System.out.println(b[i]);
//        }
    }
}
